//
//  Map.h
//  CarDemo
//
//  Created by huang kun on 8/11/10.
//  Copyright 2010 UESTC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Constant.h"

typedef struct {
	int x;
	int y;
	int direction;
} StackNode;

typedef struct {
	StackNode data[63];
	int top;
} PathStack;

	
@interface Map : NSObject {
	BlockShape array[roadRow][roadColumn];
	
	PathStack path;
	
	int inX, inY;		//进口
	int outX, outY;		//出口
	int oldX, oldY;		//当前位置
	int newX, newY;		//新的位置
	int startDirection;	//进口方向
	int endDirection;	//出口方向
	int currentDirection;	//当前方向
	int firstCheckDirection;
	
	BOOL isOut;			//越界	
	BOOL isOk;			//连通
}

@property BOOL isOk;
@property PathStack path;

- (BOOL) testMap;
- (BOOL) updateMapArray:(int)x y:(int)y block:(BlockShape)shape;
- (BOOL) shouldSet:(int)x y:(int)y;
@end
